window.supportWebp = function(callback){
  if(!window.localStorage) callback(false);
  callback = callback || function(){};
  if(localStorage.getItem('support-webp')==='1'){
    document.documentElement.setAttribute('data-support','webp')
    return callback(true);
  }
  var image = new Image();
  image.onerror = function(){
    localStorage.setItem('support-webp','0');
    callback(false);
  };
  image.onload = function(){
    if(image.width == 1){
      document.documentElement.setAttribute('data-support','webp')
      localStorage.setItem('support-webp','1');
      document.cookie = "support-webp=1; max-age=31536000; domain="
      callback(true);
    }else{
      localStorage.setItem('support-webp','0');
      callback(false);
    }
  };
  image.src = '';
}
window.supportWebp();
if(!window.Promise) {
  document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
}
